<template>
    <div>
        <el-dialog title="批量审核" :visible.sync="reviewDia" width="420px" center :close-on-click-modal="false">
            <p class="re_title">
                您已勾选:{{ tablechouseData.length }}人
            </p>
            <div class="re_sh">
                请对勾选的用户进行批量的审核处理
            </div>
            <div style="text-align: center;margin-bottom: 20px;">
                <el-button type="primary" @click="Breview(1)">通过</el-button>
                <el-button type="danger" @click="Breview(2)">驳回</el-button>
            </div>
        </el-dialog>
    </div>
</template>

<script>
import VueQr from "vue-qr";
import api from "@/api/index";
export default {
    components: {
        VueQr
    },
    props: {
        tablechouseData: Array,
        ruleForm:Object
    },
    data() {
        return {
            reviewDia: false,
        }
    },
    methods: {
        Breview(val) {
            var arrs = []
            this.tablechouseData.forEach(item => {
                arrs.push(item.personId)
            });
            let form = {
                isPass: val,
                personIds: arrs,
                reason: '',
            }
            api.selfMeting.updateMeetingPersonBatch(form).then(res => {
                if (res.code == 200 && val == 1) {
             let mobellist=''
             this.tablechouseData.forEach((item,index) => {
                if (this.tablechouseData==index+1) {
                    mobellist+=item.mobile 
                }else{
                    mobellist+=item.mobile+','
                }
                
             });
            let form = {
              str: {
                mobile: mobellist,
                mid: this.$route.query.mid,
                title: this.ruleForm.title,
                linkManDX: this.ruleForm.assistant,
                msgType: "1",
                sendType: "1",
                buttonType: "3",
                channel: "1",
              },
            };
            api.selfMeting.sendTestMsg(form).then((res) => {
              this.$message({ type: "success", message: "通过成功" });
              this.$emit('reflash',true)
            //   this.SearchListBt();
            });
          } else {
            this.$message({ type: "success", message: "驳回成功" });
            this.$emit('reflash',true)
            // this.SearchListBt();
          }
        
                this.reviewDia = false
            })
        }
    }
}
</script>

<style lang="scss" scoped>
.re_title {
    font-size: 14px;
    font-family: PingFang SC-Regular, PingFang SC;
    font-weight: 400;
    color: #A3ADB7;
    line-height: 16px;
    margin-bottom: 12px;
    text-align: center;
}

.re_sh {
    font-size: 16px;
    font-family: PingFang SC-Regular, PingFang SC;
    font-weight: 400;
    color: #76828F;
    line-height: 19px;
    margin-bottom: 30px;
    text-align: center;
}

::v-deep .el-dialog__header {
    background: #f5f8fc;
    text-align: left;
    font-size: 16px;
    color: #202933;
    padding: 11px 16px;
}

.mb55 {
    margin-bottom: 50px;
}

::v-deep .el-dialog__body {
    padding: 5px 10px 10px 32px !important;
}

::v-deep .el-dialog__title {
    font-size: 16px;
}

.share_butn {
    color: #FFF !important;
    background-color: #409EFF !important;
    border-color: #409EFF !important;
    padding: 11px 20px !important;
    margin-bottom: -7px;
    border-radius: 0;
}
</style>